package com.yun.zf.common.utils;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
public class TreeNodes {

    @ApiModelProperty(value = "城市id")
    private String id;
    @ApiModelProperty(value = "上级id")
    private String parentId;
    @ApiModelProperty(value = "城市名称")
    private String name;
    @ApiModelProperty(value = "首字母")
    private String firstPinyin;
    @ApiModelProperty(value = "子节点")
    private List<TreeNodes> children;
    @ApiModelProperty(value = "分组子节点")
    private  Map<String, List<TreeNodes>> groupChildren;

    /*public Map<String, List<TreeNodes>> getGroupChildren() {
        if (children!=null&&children.size()>0){
            Map<String, List<TreeNodes>> groupBy =  children.stream().collect(Collectors.groupingBy(TreeNodes::getFirstPinyin));
            return groupBy;
        }
        return groupChildren;

    }

    public void setGroupChildren(Map<String, List<TreeNodes>> groupChildren) {
        this.groupChildren = groupChildren;
    }*/

}
